package com.hsqn.controller;

import com.hsqn.entity.HealthAndSafety;
import com.hsqn.service.HealthAndSafetyService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


@RestController
@Slf4j
public class HealthAndSafetyController {
    @Autowired
    private HealthAndSafetyService user;

    @DeleteMapping("/{add}")
    @Operation(
            summary = "添加",
            description = "添加",
            responses = {
                    @ApiResponse(responseCode = "200", description = "添加成功",
                            content = @Content(schema = @Schema(implementation = HealthAndSafety.class))),
                    @ApiResponse(responseCode = "404", description = "添加失败")
            }
    )
    public HealthAndSafety deleteClazz(@Parameter(name = "HealthAndSafety", description = "a", required = true) @RequestBody HealthAndSafety HealthAndSafety) {
        return user.Insertelderly(HealthAndSafety);
    }
    @Operation(
            summary = "添加",
            description = "添加",
            responses = {
                    @ApiResponse(responseCode = "200", description = "添加成功",
                            content = @Content(schema = @Schema(implementation = HealthAndSafety.class))),
                    @ApiResponse(responseCode = "404", description = "添加失败")
            }
    )
    public HealthAndSafety deleteHealthRecord(@Parameter(name = "HealthAndSafety", description = "a", required = true) @RequestBody HealthAndSafety HealthAndSafety) {
        return user.InserteHealthRecord(HealthAndSafety);
    }
}
